package com.dragon.repository.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 评论表
 * </p>
 *
 * @author sy
 * @since 2023-07-24
 */
@Getter
@Setter
@TableName("dragon_comment")
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 用户id
     */
    private Integer adminId;

    /**
     * 主表id
     */
    private Integer correlationId;

    /**
     * 父级评论id
     */
    private Integer parentId;

    /**
     * 内容
     */
    private String replyText;

    /**
     * 被回复的用户id
     */
    private Integer replyAdminId;

    /**
     * 流程类型 跟进记录7  工作汇报26
     */
    private Integer streamType;

    /**
     * 评论时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    /**
     * 被回复的评论id
     */
    @TableField(exist = false)
    private Integer replyId;

    /**
     * 用户名
     */
    @TableField(exist = false)
    private String username;

    /**
     * 被回复的用户名称
     */
    @TableField(exist = false)
    private String replyUsername;

    /**
     * 头像
     */
    @TableField(exist = false)
    private String avatar;

    /**
     * 查出的子评论
     */
    @TableField(exist = false)
    private List<Comment> subComments;


}
